package db_test;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import db.ConnectionManager;

// THIS CLASS IS JUST FOR EXAMPLE FOR TESTING DB CONNECTION
// ACTUALLY THE PROJECT DOES NOT USE IT

public class Test {

	public static void main(String[] args) {
		ConnectionManager mgr = ConnectionManager.getInstance();
		Connection con = mgr.getConnection();

		try {
			Statement st = con.createStatement() ;

			ResultSet rs = st.executeQuery("SELECT * FROM FLIGHT WHERE DEPT_POINT='Istanbul Ataturk' AND ARRIVAL_POINT='Izmir Adnan Menderes' AND DEPT_DATE='15.06.2013';");

			while (rs.next()) {
				System.out.println(rs.getInt(1)+" "+ rs.getString(2) +" "+ rs.getString(3) +" "+ rs.getString(4));
			}

			rs.close();
			st.close();

		} catch (SQLException e) {
			e.printStackTrace();
		}
		mgr.closeConnection(con);
	}

}
